﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using MINERP.DAL;

namespace MINERP.BLL.Statistics.PaperManage
{
    public class PrinterBLL
    {
        public static List<Printer_Info> GetAllPrinters()
        {
            List<Printer_Info> list = new List<Printer_Info>();
            using (newSampleYPDBEntities db = new newSampleYPDBEntities())
            {
                List<printer> printerList = db.printer.ToList();               
                foreach (printer printer in printerList)
                {
                    list.Add(new Printer_Info()
                    {
                        PrinterID = printer.PrinterID,
                        PName = printer.PName,
                        HotDirPath = printer.hotDirPath,
                        IsTransverse = printer.IsTransverse ?? false,
                        PDes = printer.PDes,
                        PDPI = printer.PDPI,
                        PLength = (float)printer.PLength,
                        PWidth = (float)printer.PWidth
                    });

                }

            }
            return list;
        }
    }
}
